************************************************
***Title: robustness_wind.do
***Creators: Joelle Abramowitz, Shooshan Danagoulian, and Owen Fleming*
***Notes: This file produces the estimates of the effect of pollen exposure on suicide using wind speed and wind direction as a control/interaction. 

*For questions, contact
*Owen Fleming
*hg3490@wayne.edu
************************************************


**********SETUP
use data/for_analysis, clear

*Macro definition of weather with no wind
global weather_no_wind tmin tmin_sq tmax tmax_sq tmean tmean_sq any_precip


**********PRODUCE ESTIMATES
*Treatment: location-season quartiles
eststo main_s3_wind1: ppmlhdfe count pollen_q2_ls pollen_q3_ls pollen_q4_ls wind_speed_q4_ls wind_dir_90_180 wind_dir_180_270 wind_dir_270_360 $weather_no_wind, absorb(county year_month month_day) cluster(county) tolerance(1e-06)
estadd ysumm
estadd scalar counties = e(N_clust)
estadd local Controls "Weather, Wind speed Q4 indicator, Wind direction in 4 bins" 
estadd local FE "County, Year x Month, Month x Day"

*Treatment: location-season quartiles
eststo main_s3_wind2: ppmlhdfe count pollen_q2_ls c.pollen_q2_ls#c.wind_speed_q4_ls c.pollen_q2_ls#c.wind_dir_90_180 c.pollen_q2_ls#c.wind_dir_180_270 c.pollen_q2_ls#c.wind_dir_270_360 pollen_q3_ls c.pollen_q3_ls#c.wind_speed_q4_ls c.pollen_q3_ls#c.wind_dir_90_180 c.pollen_q3_ls#c.wind_dir_180_270 c.pollen_q3_ls#c.wind_dir_270_360 pollen_q4_ls c.pollen_q4_ls#c.wind_speed_q4_ls c.pollen_q4_ls#c.wind_dir_90_180 c.pollen_q4_ls#c.wind_dir_180_270 c.pollen_q4_ls#c.wind_dir_270_360 wind_speed_q4_ls wind_dir_90_180 wind_dir_180_270 wind_dir_270_360 $weather_no_wind, absorb(county year_month month_day) cluster(county) tolerance(1e-06)
estadd ysumm
estadd scalar counties = e(N_clust)
estadd local Controls "Weather, Wind speed Q4 indicator, Wind direction in 4 bins" 
estadd local FE "County, Year x Month, Month x Day"


**********EXPORT
estout using results/robustness_wind.xls, cells(b(star label(Coef.) fmt(4)) se(par(`"="("'`")""') label(Std. Err.) fmt(4))) stats(ymean N counties Controls FE) starlevels(* 0.1 ** 0.05 *** 0.01) keep(pollen_q2_ls c.pollen_q2_ls#c.wind_speed_q4_ls c.pollen_q2_ls#c.wind_dir_90_180 c.pollen_q2_ls#c.wind_dir_180_270 c.pollen_q2_ls#c.wind_dir_270_360 pollen_q3_ls c.pollen_q3_ls#c.wind_speed_q4_ls c.pollen_q3_ls#c.wind_dir_90_180 c.pollen_q3_ls#c.wind_dir_180_270 c.pollen_q3_ls#c.wind_dir_270_360 pollen_q4_ls c.pollen_q4_ls#c.wind_speed_q4_ls c.pollen_q4_ls#c.wind_dir_90_180 c.pollen_q4_ls#c.wind_dir_180_270 c.pollen_q4_ls#c.wind_dir_270_360 wind_speed_q4_ls wind_dir_90_180 wind_dir_180_270 wind_dir_270_360) order(pollen_q2_ls c.pollen_q2_ls#c.wind_speed_q4_ls c.pollen_q2_ls#c.wind_dir_90_180 c.pollen_q2_ls#c.wind_dir_180_270 c.pollen_q2_ls#c.wind_dir_270_360 pollen_q3_ls c.pollen_q3_ls#c.wind_speed_q4_ls c.pollen_q3_ls#c.wind_dir_90_180 c.pollen_q3_ls#c.wind_dir_180_270 c.pollen_q3_ls#c.wind_dir_270_360 pollen_q4_ls c.pollen_q4_ls#c.wind_speed_q4_ls c.pollen_q4_ls#c.wind_dir_90_180 c.pollen_q4_ls#c.wind_dir_180_270 c.pollen_q4_ls#c.wind_dir_270_360 wind_speed_q4_ls wind_dir_90_180 wind_dir_180_270 wind_dir_270_360) legend label replace 
eststo clear


